package day06;

import java.util.Arrays;
import java.util.Random;

public class DayHomeWork06Practice1 {
    public static void main(String[] args) {
        say();
        say(22);
        say("吴羽", 22);
        int num = sum(1, 2);
        System.out.println("两数之和为：" + num);
        int[] arr = generateArray(10);
        System.out.println("生成的整型数组为：");
        System.out.println(Arrays.toString(arr));

    }

    public static void say() {
        System.out.println("你好");
    }

    public static void say(int age) {
        System.out.println("你的年龄是" + age + "岁");
    }

    public static void say(String name, int age) {
        System.out.println("你的名字是：" + name + "     你的年龄是：" + age);
    }

    public static int sum(int a, int b) {
        return a + b;
    }

    public static int[] generateArray(int n) {
        Random rand = new Random();
        int[] arr = new int[n];
        for (int i = 0; i < arr.length; ++i) {
            arr[i] = rand.nextInt(100);
        }
        return arr;
    }
}
